package com.polukeuro.app.client.widgets;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
import com.polukeuro.app.client.jnsi.Team;
import com.polukeuro.app.client.manager.WidgetManager;

public class TeamWidget extends Composite {
	
	interface TeamWidgetUiBinder extends UiBinder<Widget, TeamWidget> {
	}

	@UiField
	AbsolutePanel team;
	
	@UiField
	Label teamLabel ;
	
	@UiField
	AbsolutePanel teamLogo;
	
	private static TeamWidgetUiBinder uiBinder = GWT.create(TeamWidgetUiBinder.class);

	public TeamWidget(Team team) {
		initWidget(uiBinder.createAndBindUi(this));
		WidgetManager.getInstance().showLoader(this);
		teamLabel.setText(team.getName());
		teamLogo.addStyleName(team.getTrigram());
		WidgetManager.getInstance().hideLoader(this);
	}
	
}
